package com.sky.api.client;

import com.sky.api.client.fallback.ProductFallbackFactory;
import com.sky.api.config.DefaultFeignConfig;
import com.sky.api.domain.vo.DishVO;
import com.sky.api.domain.vo.SetmealVO;
import com.sky.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;
import java.util.Map;

/**
 * @author toki
 */
@FeignClient(name = "product-service",
        configuration = DefaultFeignConfig.class,
        fallbackFactory = ProductFallbackFactory.class)
public interface ProductFeignClient {

    @GetMapping("/admin/setmeal/count")
    Result<Integer> countSetmealByMap(@RequestParam("status") Integer status);

    @GetMapping("/admin/setmeal/{id}")
    Result<SetmealVO> getSetmealById(@PathVariable Long id);

    @GetMapping("/admin/dish/{id}")
    Result<DishVO> getDishById(@PathVariable Long id);

    @GetMapping("/admin/dish/count")
    Result<Integer> countDishByMap(@RequestParam("status") Integer status);

}
